package glemipsc.instructions;
import glemipsc.Address;
import glemipsc.Function;
import glemipsc.Type;
import glemipsc.implementations.Argument;
import glemipsc.instructions.Expression;
import glemipsc.instructions.Instruction;

import java.io.Serializable;
import java.util.*;

public class CastedExpression extends BaseInstruction implements Serializable, Expression, Instruction {
	private Expression exp;
	private Type type;
	private Address addr;
	
	public CastedExpression(Expression exp, Type type) {
		this.type = type;
		this.exp = exp;
	}
	
	public int getNumberOfOperands() {
		return 0;
	}

	public Expression getOperand(int index) {
		return null;
	}

	public int getSize() {
		return 0;
	}

	public Type getType() {
		return type;
	}

	public int getImmediateValue() {
		return exp.getImmediateValue();
	}

	public boolean isImmediate() {
		return exp.isImmediate();
	}

	public Address getStoreAddress() {
		return addr;
	}

	public int getStoredSize() {
		// TODO Auto-generated method stub
		return 0;
	}

	public boolean isStored() {
		return !isImmediate();
	}

	public void setStoreAddress(Address addr) {
		this.addr = addr;
	}

	public void computeInstruction(Argument result, List<glemipsc.implementations.Instruction> instructions, Function func) {
		// TODO Auto-generated method stub
		
	}

}
